package club.janna.jrpc.remoting.netty;

import club.janna.jrpc.annotation.SPIService;
import club.janna.jrpc.remoting.*;

import java.net.URI;

/**
 * @author Panbo.Guo
 */
@SPIService("netty")
public class NettyTransporter implements Transporter {
    @Override
    public void start(URI uri, Codec codec, Handler serverHandler) {
        new NettyServer().start(uri, codec, serverHandler);
    }

    @Override
    public Channel connect(URI uri, Codec codec, Handler clientHandler) {
        return new NettyClient().connect(uri, codec, clientHandler);
    }
}
